home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / mail / delivery / sendmail.002 / sendmail / sendmail-8.7.3-bin / 00README.linux next >
Encoding:
Text File  |  1995-12-14  |  15.6 KB  |  357 lines

  1. # Copyright (c) 1994,1995 Jason L. Haar
  2. # Copyright (c) 1994,1995 Lazerjem Ltd.
  3. # All rights reserved.
  4. #
  5. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  6. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  7. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  8. # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  9. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  10. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  11. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  12. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  13. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  14. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  15. # SUCH DAMAGE.
  16. #
  17. #    @(#)00README.linux    1.0 (Lazerjem)    17/Jul/94
  18. #                        23/Feb/95
  19. #                        2/Apr/95
  20. #                                               14/Dec/95
  21.  
  22. This is a binary release of sendmail-8.7.3 for Linux. I think this
  23. package should give you a _total_ MTA environment - from sendmail down
  24. to local delivery agents mail.local and (by popular demand!) procmail
  25. (v3.11pre3) [thanks to Stephen R. van den Berg for the package, and
  26. allowing me to include the binaries here].
  27.  
  28. This was compiled under Linux 1.2.13; gcc-2.5.8/libc-4.5.26.
  29.  
  30. Sendmail can be compiled for use on a NIS network - but I didn't need that
  31. so it isn't here :-) Also, I used the New Berkeley DB database instead of
  32. the older 'dbm' format 'cause it's better. I've also included mail.local and
  33. my procmail binary distribution - a bigger package overall, but procmail is
  34. soooo good, I feel it should be shared by all :-)
  35.  
  36. I have put together an install script 'install_sendmail' which isn't
  37. intended to be run blindly. Edit it to match your situation (BUT KEEP
  38. READING THIS FILE FIRST!).
  39.  
  40. Below is an introductory article to sendmail I've written that may be of
  41. help to those just getting into the area. Don't forget - for any real detail
  42. - Read The Manual! I've included a copy of the Sendmail Operation Manual in
  43. this distribution (PostScript and Text form [the latter looks OK to me in an
  44. xterm and console - anything else I can't guarantee]). It's a bit of a
  45. jumble of information - some only appropriate for those wanting to compile
  46. the package themselves - and some which everyone should read/know.
  47.  
  48. Something else I wrote (file Internet-Mail) may be of help to real
  49. beginners. It covers the DNS (you can't run mail on the Internet without
  50. knowledge of this) as well as Internet mail itself.
  51.  
  52. Any comments to me at:
  53.  
  54.         Jason Haar <j.haar@lazerjem.demon.co.uk>
  55.  
  56.                 Sendmail V8
  57.                 -----------
  58.  
  59. Sendmail-V8 (latest release 8.7.3) is written by Eric Allman, and is
  60. considered the official release of sendmail. Most vendors base their own
  61. sendmail on this release, but they usually screw up somewhere ;-). If you
  62. are managing a network of Unix boxes of differing vendors, I'd STRONGLY
  63. suggest that you throw out all the vendor-specific sendmail and install
  64. sendmail-V8 instead. Configuration format for sendmail is specific to each
  65. vendor, thus you will save yourself a lot of work by learning one sendmail
  66. really well instead of several poorly.
  67.  
  68. Usenet News is the best place to get help from about sendmail. The
  69. newsgroups comp.mail.sendmail (and friends) are read by the authors of
  70. the major Email packages, and provide good advice, as well as
  71. announcements of bug fixes and security holes. 
  72.  
  73. ** NOTE ** Unless you have a problem compiling sendmail, NONE of the
  74. Linux newsgroups/mailing-lists are appropriate for such questions -
  75. let's try to lower the amount of traffic on those groups by ensuring
  76. our enquiries go to the right places. There's nothing special about
  77. Linux now - it's just another Un*x :-)
  78.  
  79. IDA vs Sendmail V8
  80. -------------------
  81.  
  82. Which is best? Sendmail V8 :-)
  83.  
  84. The current version of 8.7.3 contains support for more new features than
  85. IDA, such as MIME support and 8-bit traffic. These are standards-based,
  86. unlike similar features in the current version of IDA.  Also, the mere fact
  87. that it is newer means that there are more bug fixes, including several
  88. security bugs that still affect most other versions. 
  89.  
  90. If you are interested in compiling your own version from scratch, the
  91. official anonymous ftp site for sendmail-8.7.3 is:
  92.  
  93. <URL:ftp://ftp.cs.berkeley.edu:/ucb/src/sendmail/sendmail.8.7.3.tar.gz>
  94.  
  95. The latest release (as at 2nd Oct 1995) is 8.7.3. This package amounts to
  96. over 900Kbytes (tar.gz), and includes full documentation on sendmail. By
  97. that I mean FULL. O'Reilly & Associates have recently published a Nutshell
  98. Handbook on sendmail (covers both V8 and IDA - really good), but the docs in
  99. this distribution would be more than enough for anyone to really get into
  100. the nitty-gritty of sendmail.
  101.  
  102. Anyway, if you decide on sendmail-V8, get the latest version.  8.7.3
  103. compiles and runs fine under Linux - you could just type "makesendmail".
  104. BTW, I also grabbed the db-1.85 package so that I could use the
  105. reverse-alias features of sendmail (my binaries use db instead of dbm for
  106. this too).
  107.  
  108. [NOTE to sendmail-8.6 users: FLOCK is still broken under Linux - but under
  109. 8.7 that is known - you don't need to set HASFLOCK to 0 anymore - it already
  110. is :-) ]
  111.  
  112.  
  113. Don't forget to ALWAYS copy out of the way any existing files you have, just
  114. in case you want to go back to an older release.
  115.  
  116. The 'install_sendmail' script contains information on file-protections that
  117. I use - they're about as scrict as you can put them. The "getloadav" feature
  118. of sendmail normally needs sendmail to be setgid to kmem, but Linux's /proc
  119. file system removes the need for that :-)
  120.  
  121. Sendmail can be used in one of two ways.
  122.  
  123. 1)     Started from /etc/rc.* (default). This means sendmail is running
  124.     continually. Invoked as:
  125.  
  126.     /usr/lib/sendmail -bd -q1h
  127.  
  128.     The "-bd" option tells sendmail it is running as a permanent daemon,
  129.     and the "-q1h" tells it that Email messages that weren't deliverable
  130.     the first time are to be re-tried at 1 hour intervals. If you
  131.     are on a SLIP/PPP link, even 1 hour may be too often - you
  132.     could take it out altogether and manaully run the queue during
  133.     the first moments of bringing up your PPP/SLIP link (via
  134.     'sendmail -q').
  135.  
  136. 2)    Started from /etc/inetd.conf. This means sendmail is only running
  137.     when there is an incoming SMTP connection, but this actually is
  138.     heavier on the system due to the overheads at initial startup. The
  139.     advantage of this method is that you can use tcp_wrapper on it, so
  140.     that you can configure just who can make SMTP connections to you.
  141.  
  142.     Invoked as:
  143.  
  144.     /usr/lib/sendmail -bs
  145.  
  146.     The "-bs" means run as a SMTP connection, that exits after it
  147.     finishes. You can't use the "-q" option here, so this must be
  148.     done manually by creating a cron job to run at regular
  149.     intervals (doesn't need to be as root unless you're using the
  150.     "restrictqrun" option).
  151.  
  152. Sendmail reads the file /etc/sendmail.cf at startup, and logs everything via
  153. syslog. If you have problems with sendmail, see what /var/log/syslog tells
  154. you (assuming that's where your syslog messages for mail goes to).
  155.  
  156. Sendmail is very difficult to configure. The secret to success with sendmail
  157. is to configure it as little as possible. You should take some time (days to
  158. weeks) to decide just what you want sendmail to do for you. A lot of sites
  159. end up with extremely ugly- looking sendmail configurations because they
  160. didn't plan in advance, and then are forced to "patch it up" as time goes
  161. by.
  162.  
  163. Both sendmail-8.7.3 and sendmail-IDA use the m4 preprocessor to manipulate
  164. their config files. My own config file for sendmail is 14 lines long, yet m4
  165. produces a 600+ line file out of that which sendmail actually uses. This
  166. preprocessor design greatly simplifies the creation and management of
  167. sendmail config files. Not only are they more human-readable, but global
  168. configuration bugs and re-writes can be corrected very quickly and
  169. seamlessly with patches.
  170.  
  171. Sendmail-8.7.3 comes with several example configurations that you can look
  172. over for help (in cf/cf). My own config is called lazerjem.mc. You simply
  173. run m4 on these ".mc" files to create ".cf" files that sendmail would
  174. actually use.
  175.  
  176. E.g
  177.  
  178.     m4 lazerjem.mc > sendmail.cf
  179.  
  180.  
  181. *** PLEASE!!!! Don't use any of these without editing!!! ***
  182.  
  183. Some Configuration Options
  184. --------------------------
  185.  
  186. I won't go into too much detail here as they are all covered in the
  187. documentation and README file in the "cf" directory. However, I will comment
  188. on a few that I think are important/interesting.
  189.  
  190. *** FEATURE(always_add_domain)
  191.  
  192. I _always_ configure mailers to _always_ write the fully qualified domain
  193. name after every address - even local ones (e.g.
  194. "jason@lazerjem.demon.co.uk" instead of "jason@lazerjem" or even "jason").
  195.  
  196. My reason for this is to ensure that the people using Email always know what
  197. their "true" Email address is - not just a limited part of it. There have
  198. been so many times I've talked to people who didn't know what their own
  199. Email address was, because their site hadn't configured their MTAs to fully
  200. expand all addresses.
  201.  
  202. *** define(`confUSERDB_SPEC', `/etc/userdb.db')dnl
  203.  
  204. This allows you to perform "reverse aliasing" on outgoing messages. The
  205. "/etc/aliases" file allows you to define strings which map to usercodes;
  206. well the reverse-alias file allows you to map usercodes onto strings! That
  207. way you can have all your Email going out as "j.haar@lazerjem.demon.co.uk"
  208. instead of "jason@lazerjem.demon.co.uk" (where "jason" is the usercode).
  209. This requires the New Berkeley DB format - none of the others will do. I'd
  210. suggest compiling sendmail with this database format as it supposedly
  211. operates faster/more efficiently than any of the others anyway - as well as
  212. allowing you to share the database files over different architectures -
  213. something no other database format can do. You can get this database package
  214. from:
  215.  
  216.  <URL:ftp://ftp.cs.berkeley.edu:/ucb/4bsd/db.1.85.tar.Z>
  217.  
  218.  
  219. *** FEATURE(local_procmail)
  220.  
  221. This tells sendmail to configure itself to use procmail as it's local mailer
  222. instead of <whatever>. However, I like using the "-t" option to procmail
  223. which says that if procmail fails to deal with a message (say, due to
  224. diskspace problems, or a bad .procmailrc file), then it will tell sendmail
  225. to REQUEUE to message instead of BOUNCING it. So in lazerjem.mc you will see
  226. I override the default values of PROCMAIL_MAILER_ARGS and LOCAL_MAILER_ARGS
  227. - adding "-t".
  228.  
  229. *** define(`LUSER_RELAY', procmail:/etc/procmailrcs/lusers)dnl
  230.  
  231. This is a feature much asked after for dialup sites. LUSER is the action to
  232. do when a message comes in for a local address that doesn't exist. Normally
  233. such messages are bounced "No such user" - this option allows such messages
  234. to instead be accepted and delivered to the routine mentioned. In the cf/cf
  235. directory, you will find my /etc/procmailrcs/lusers file - very
  236. sophisticated ;-)
  237.  
  238. *** define(`SMART_HOST', smtp:host.domain)
  239.  
  240. This is to be used if you are allowed to redirect all your non-local
  241. mailer to a smarter mail hub. Good for PPP/SLIP sites. Check with your
  242. Network Provider to see if they'd mind you doing that - it saves you
  243. having to hang around waiting for connections to succeed/fail. 
  244.  
  245. NOTE: That reminds me. Don't forget that EVERY SMTP site/machine *must
  246. always* accept Email for "postmaster@machine_name". This alias usually
  247. points to the person who is responsible for Email on that system - probably
  248. you! So *make sure* there is an entry for postmaster in your /etc/aliases
  249. file; mine looks like this:
  250.  
  251. #/etc/aliases
  252. #----- BEGIN FILE -------
  253.  
  254. postmaster:    jason
  255. mailer-daemon:    postmaster
  256. root:        postmaster
  257. j.haar:        jason
  258. jason.haar:    jason
  259.  
  260. Don't forget that aliases aren't case-sensitive - "PostMASter" is the same
  261. as "postmaster".
  262.  
  263. For reverse-aliases, your file appears as follows:
  264.  
  265. #/etc/userdb
  266. #--- BEGIN FILE ---
  267.  
  268. jason:mailname  J.Haar@lazerjem.demon.co.uk
  269.  
  270. #--- END FILE ---
  271.  
  272. Then you run makemap on it to produce the DB file sendmail actually
  273. uses.
  274.  
  275. makemap btree /etc/userdb.db < /etc/userdb
  276.  
  277. I actually wrote a wee script to replace 'newaliases' so that both
  278. aliases and reverse-aliases files were updated simultaneously when
  279. it's run.
  280.  
  281. What options do I need?
  282. -----------------------
  283.  
  284. This is why sendmail is so difficult to configure. A site may need a
  285. gateway into UUCP, fax software, X400, as well as SMTP. All these
  286. require their own special calls/rewrites, and it all adds up into one
  287. big mess. The m4 preprocessor goes some way towards simplifying all
  288. this by allowing mail managers to produce macros which "plug into"
  289. their existing sendmail configurations. Two such examples are the
  290. Usenet and Fax gateways (the hooks, not the software ;-) that are
  291. included in the base sendmail distribution - I personally use the fax
  292. gateway with FlexFAX (a freely available fax package). If you decide
  293. to use them, you just have to add one or two lines to your sendmail
  294. ".mc" file, and re-create your config. I personally like the new
  295. sendmail as it is possible to remove all UUCP-related code with one
  296. line ("FEATURE(nouucp)") - I have no need for any of that.
  297.  
  298. I will just cover what I feel are the three most likely configurations
  299. for sendmail hosts. Anything more complicated than this will require
  300. more options than I can possibly cover - so Read The Fine Manual! :-)
  301.  
  302. 1)    These days a lot of networked machines having some form of direct
  303.     Internet access, so it is relatively easy to come up with sendmail
  304.     configurations for these. Most will probably just want local mail to
  305.     be handled by the local mailer, and all the rest to be dealt with by
  306.     the DNS/SMTP pair. The file tcpproto.mc does this job for you.
  307.     Actually, my file lazerjem.mc will also do the trick - the only
  308.     change being that you don't need the SMART_HOST option (that's
  309.     basically the only difference between a SLIP/PPP site and a
  310.     fully-connected site).
  311.  
  312.  
  313. 2)    You may have a nice cluster of Linux workstations which NFS mount
  314.     their /var/spool/mail partition from a central hub. As you don't
  315.     want these workstations to handle incoming mail themselves, you can
  316.     put a minimal config file on them that simply directs all mail that
  317.     they send to the hub to deal with.  Don't forget that these machines
  318.     won't need a sendmail daemon running on them (only needed for
  319.     incoming - not outgoing), so save a little memory and remove it from
  320.     the appropriate /etc/rc* file (although you may need a queuing run
  321.     [sendmail -q] to run on occasion from cron for the case when the hub
  322.     is down). For this setup, just use clientproto.mc
  323.  
  324.     NOTE: Running mail over NFS is potentially pretty rotten - you have
  325.     to be VERY careful about file locking. Ensure you're running lockd
  326.     or statd on the server, and YOU REALLY SHOULD use procmail as you're
  327.     local delivery agent - it is very good at handling file locking -
  328.     even over NFS.
  329.  
  330.  
  331. 3)    Dial-up Internet connections. That means SLIP or PPP. I just use the
  332.     'nodns' option. Under 8.7.3, that actually stops sendmail bothering
  333.     to ask the DNS for anything. So if you send a mail message to
  334.     yourself, or to anything mentioned in your /etc/hosts file, then
  335.     sendmail will do it without bothering to ask the DNS (in the past it
  336.     would always do a DNS lookup - even for local deliveries.).
  337.     I use dial-on-demand PPP, and with sendmail-8.7.3 everything is
  338.     perfect. If mail is sent locally - it just gets delivered, but if
  339.     a message is sent to an unknown host, then sendmail tries to connect
  340.     to the SMART_HOST - which starts the dial-on-demand PPP link. I also
  341.     have ppp configured to force a sendmail queue run (sendmail -q)
  342.     whenever the link goes up (via /etc/ppp/ip-up).
  343.  
  344.  
  345. Packages mentioned:
  346. ------------------
  347.  
  348. sendmail    ftp://ftp.cs.berkeley.edu/ucb/src/sendmail/sendmail.8.7.3.tar.gz
  349.  
  350. procmail    ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail.tar.gz
  351.  
  352. db        ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz 
  353.  
  354.  
  355. As usual - _please_ use archie to find a closer site to you than
  356. these. 
  357.